package com.heima.service.Impl;

import com.heima.dao.AccountDao;
import com.heima.pojo.Account;
import com.heima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

//@Controller的子类注释，业务层
@Service
public class AccountServiceImpl implements AccountService {
    //属性注解，自动装配，设置属性的对象或对方法进行传参 不需要set方法
    @Autowired
    AccountDao accountDao;

    @Override
    public int add(Account account) {
        return accountDao.add(account);
    }
    @Override
    public int update(Account account) {
        return accountDao.update(account);
    }
    @Override
    public int delete(Integer id) {
        return accountDao.delete(id);
    }
    @Override
    public List<Account> findAll() {
        return accountDao.findAll();
    }
    @Override
    public Account findById(Integer id) {
        return accountDao.findById(id);
    }
}